package com.nanbei.a01.component;

import com.nanbei.a01.event.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @ClassDescription:
 * @JdkVersion: 1.8
 * @Author: libs
 * @Created: 2024/9/4 16:03
 */
@Component
@Slf4j
public class Component1 {

    @Autowired
    private ApplicationEventPublisher eventPublisher;

    /**
     *
     * eventPublisher 事件发布器
     * 发送事件
     */
    public void register(){
        log.info("用户注册");
       // eventPublisher.publishEvent(new EmailEvent(this,"向用户发送邮件"));
        eventPublisher.publishEvent(new PhoneEvent(this,"向用户发送短信"));
    }

}
